<?php
	/******Function : Warabi User Class******/
	/******Author : Feifei******/
	/******Date : 12/04/2008 ****/
	require_once('class.base.php');

	class cardlist extends base{
	
		function get_AllCard_SelectResult($pid , $siid){
			$siid = $this->safePara($siid);
			
			$scon = empty($siid)?"":"and cardInfoId = ".$siid." ";
			
			$limit = empty($scon)?("limit ".($pid*PER_NUM)." , ".PER_NUM):"";

			$obj = array(
				array("type" => ET_SELECT),
				array("*"),
				array("1"=>"1"),
				array(
					$scon,
					"order by cardListId",
					$limit
				)
			);
			$this->__set("execObj" , $obj);
			return $this->__getAssocResult();
		}

		function get_AllCard_Num(){
			$obj = array(array("type" => ET_COUNT));
			$this->__set("execObj" , $obj);
			return $this->__getTableNum();
		}
	
		function showName(){
			return $this->tableName;
		}

		function update_OneCard($userid){
			$obj = array(
				array("type" => ET_UPDATE),
				array(
					"deleteFlag" => 1
				),
				array("cardListId" => $userid),
				array("card_list")
			);
			$this->__set("execObj" , $obj);
			if(!$this->__updateOneResult()){
				echo "fail";
			}
			else echo $userid;
		}

	}

	$cardlist = new cardlist("card_list");

?>